<?php if (!empty($top_menu["banner_url"])) : ?>
    <img src="<?= $top_menu["banner_url"]?>" style="width:100%;margin-bottom: 10px;margin-top: -10px">
<?php endif; ?>

<div class="panel panel-default">
    <div class="panel-body">
        <?php if (!empty($children_menu)) : ?>
            <div class="sub-nav">
                <?php foreach ($children_menu as $key=>$child_menu) { ?>
                    <a href="/home/menu?s=<?= $child_menu["menu_name"] ?>"
                       class="<?= ($this->params['sub_meun_active_id'] == $child_menu["objectId"]) ? 'active' : '' ?>"><?= $child_menu["menu_name"] ?></a>
                    <?php if ($key!=count($children_menu)-1) : ?>
                        <i>|</i>
                    <?php endif; ?>
                <?php } ?>
            </div>
        <?php endif; ?>

        <?php if ($top_menu["menu_type"] == 2) : ?>
            <?php if (!empty($content_list["content_list"])) : ?>
                <div>
                    <?= current($content_list["content_list"])["detail"] ?>
                </div>
            <?php endif; ?>
        <?php elseif($top_menu["menu_type"] == 1): ?>
            <div class="row">
                <?php foreach ($content_list["content_list"] as $content) { ?>
                    <div class="col-md-4">
                        <div class="thumbnail" style="border: 0">
                            <a target="_blank" href="/home/content?id=<?= $content["objectId"] ?>">
                                <img style="height: 200px;" src='<?= empty($content["image_url"]) ? "/images/default.png" : $content["image_url"] ?>'/>
                            </a>
                            <div class="caption text-break text-center">
                                <a target="_blank" href="/home/content?id=<?= $content["objectId"] ?>"><?= $content["title"] ?></a>
                            </div>
                        </div>
                    </div>
                <?php } ?>
            </div>
            <div style="padding-left: 15px"><?= $content_list["page_html"] ?></div>
        <?php else: ?>
            <div class="n-list">
                <ul>
                    <?php foreach ($content_list["content_list"] as $content) { ?>
                        <li>
                            <div class="list-box">
                                <h3>
                                    <a target="_blank" href="/home/content?id=<?= $content["objectId"] ?>"><?= $content["title"] ?></a>
                                </h3>
                                <div class="info">
                                    <span>
                                        <i class="glyphicon glyphicon-calendar"></i>
                                        <?= $content["createdAt"] ?>
                                    </span>
                                    <span>
                                        <i class="glyphicon glyphicon-eye-open"></i>
                                        <?= empty($content["hits"])?0:$content["hits"] ?>次
                                    </span>
                                </div>
                                <div class="note">
                                    <?php if (empty($content["image_url"])) : ?>
                                        <p style="width: 100%">
                                            <?= $content["pre_detail"] ?>
                                        </p>
                                    <?php else: ?>
                                        <div class="img-box">
                                            <img  src='<?= empty($content["image_url"]) ? "/images/default.png" : $content["image_url"] ?>'/>
                                        </div>
                                        <p>
                                            <?= $content["pre_detail"] ?>
                                        </p>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </li>
                    <?php } ?>
                </ul>
            </div>
            <div style="padding-left: 60px"><?= $content_list["page_html"] ?></div>
        <?php endif; ?>
    </div>
</div>